package cn.tworice.admin.service;import cn.tworice.admin.service.CrudService;import cn.tworice.admin.service.InductsListenerService;import cn.tworice.admin.dao.DistValueDao;import cn.tworice.common.entity.code.*;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Service;import java.util.List;@Service
public class DistValueService implements InductsListenerService<DistValue>, CrudService<DistValue> {    @Autowired
private DistValueDao dao;    public List<DistValue> getList(Integer page, Integer pageSize,DistValue entity) {        return dao.queryList(page * pageSize, pageSize,entity);    }    public int getTotal(DistValue entity){        return dao.queryTotal(entity);    }    public int set(DistValue entity) {        if(entity.getId()==null){            entity.setDate(System.currentTimeMillis());            return dao.insert(entity);        }else{            return dao.update(entity);        }    }    public int del(Integer[] ids) {        return dao.del(ids);    }    @Override    public int save(List<DistValue> list) {        list.forEach(item->{            item.setDate(System.currentTimeMillis());        });        return dao.insertList(list);    }    public DistValue getInfo(Integer id) {        return dao.queryInfo(id);    }}